﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Media;

namespace SafeLoad.NControl.Converter
{
  public class PumpStateConverter : IValueConverter
  {
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
      bool state = System.Convert.ToBoolean(value);
      if (state)
      {
        return Color.FromRgb(0, 240, 0);
      }
      else
      {
        return Color.FromRgb(220, 220, 220);
      }
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
      return value;
    }
  }
}
